FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ Asia/Shanghai
ENV LANG zh_CN.UTF-8
ENV DEPLOY_PASSWORD="root"

RUN echo "deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse\n \
deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse \n \
deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse\n	\
deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse\n"\
            > /etc/apt/sources.list        \
            && apt update && apt install -y \
            && apt install curl -y \
            python python3-pip\
            iputils-ping \
			openssh-server \
			vim \
			&& apt clean \
			&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp* \
			&& echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
RUN python2 get-pip.py
RUN pip2 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ \
            && pip2 config set install.trusted-host mirrors.aliyun.com \
            && pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ \
            && pip3 config set install.trusted-host mirrors.aliyun.com \
            && pip2 install kubernetes \
            && pip2 install pytz

RUN mkdir /var/run/sshd

EXPOSE 22
CMD echo root:${DEPLOY_PASSWORD} | chpasswd && /usr/sbin/sshd -D

# docker build -f ./Dockerfile -t ssh/base/ssh:1.0.0  .